Scenario #5005: Create New Mailinglist As Global Admin

UseCase Subscribe Existing Person And Contact To Mailinglist => Mailinglist: first-gmbh-internal

Properties

Required

Given

name value
partnerPersonTradeName First GmbH
subscriberFamilyName Miller
subscriberGivenName Michael
subscriberEMailAddress michael.miller@example.org
mailingList first-gmbh-internal

Person: First GmbH

HTTP GET "/api/hs/office/persons?name=First+GmbH" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "f726eb70-6779-41eb-a327-09e132a0cdd5", // Person: First GmbH
  "personType" : "LEGAL_PERSON",
  "tradeName" : "First GmbH",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Person: Michael Miller

HTTP GET "/api/hs/office/persons?name=Miller" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "61c75b74-1a26-4e74-adc0-6506b455c4cd", // Person: Michael Miller
  "personType" : "NATURAL_PERSON",
  "tradeName" : null,
  "salutation" : null,
  "title" : null,
  "givenName" : "Michael",
  "familyName" : "Miller"
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Contact: michael.miller@example.org

HTTP GET "/api/hs/office/contacts?emailAddress=michael.miller@example.org" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "508fc52c-61d6-42ce-bfb3-26899ffa5183", // Contact: michael.miller@example.org
  "caption" : "Michael Miller",
  "postalAddress" : { },
  "emailAddresses" : {
    "main" : "michael.miller@example.org"
  },
  "phoneNumbers" : { }
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Subscribe Michael Miller to first-gmbh-internal

HTTP POST "/api/hs/office/relations" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "type" : "SUBSCRIBER",
  "mark" : "first-gmbh-internal",
  "anchor.uuid" : "f726eb70-6779-41eb-a327-09e132a0cdd5", // Person: First GmbH
  "holder.uuid" : "61c75b74-1a26-4e74-adc0-6506b455c4cd", // Person: Michael Miller
  "contact.uuid" : "508fc52c-61d6-42ce-bfb3-26899ffa5183" // Contact: michael.miller@example.org
}
EOF
=> status: 201 CREATED 01c7cc1a-2cf8-4fdd-9e2f-77c27084b0c1

generated on 2026-08-10 01:37:55 for branch